<?php
/**
 * Created by PhpStorm.
 * User: 24369
 * Date: 2021/6/24
 * Time: 14:54
 */
namespace app\admin\controller;

use app\admin\BaseController;
use app\admin\logic\OrderLogic;
use app\admin\model\OrderStatus;
use think\facade\Request;
use think\facade\View;

class Order extends BaseController
{
    public function orderList()
    {
        //处理搜索条件
        $where=OrderLogic::getWhere();
        //关键字
        $keywords=Request::param('keywords','');
        //订单状态查询
        $order_status=OrderStatus::field(true)->select();
        View::assign('order_status',$order_status);
        //订单列表展示
        $list=\app\admin\model\Order::getOrderList($where,$keywords);
        View::assign('list',$list);
        return  view();
    }
    public function orderDetail()
    {
        return  view();
    }
    //订单软删除
    public function orderSoftDelete()
    {
        $id=Request::param('id');
        if ($id){
            $del=\app\admin\model\Order::destroy($id);
            if ($del){
                $this->success('删除成功',url('Order/orderList'));
            }else{
                $this->error('删除失败',url('Order/orderList'));
            }
        }
    }
}